module.exports =   function generateOrderNumber(length=12){
    const now = new Date();
    let year=now.getFullYear().toString();
    let month = (now.getMonth() + 1).toString();
    let day = now.getDate().toString();
    let hour = now.getHours().toString();
    let minutes = now.getMinutes().toString();
    let seconds = now.getSeconds().toString();
    // 存放订单号
    let num = '';
    // N位随机数(加在时间戳后面)
    for (var i = 0; i < length; i++)
    {
        num += Math.floor(Math.random() * 10);
    }
    return year+month+day+hour+minutes+seconds+num;
}

